#ifndef DSPSIMULATOR_STRINGTOOLS_H
#define DSPSIMULATOR_STRINGTOOLS_H

#include <string>

namespace simulator {

    static bool replace(std::string &str, const std::string &old_substr, const std::string &new_substr) {
        size_t index = str.find(old_substr);
        if (index == str.npos) {
            return false;
        }
        str.replace(index, old_substr.size(), new_substr);
        return true;
    }
}
#endif //DSPSIMULATOR_STRINGTOOLS_H
